<%@ page import="kickboxing.model.Newsy"%>
<%@page import="java.util.List"%>
<%@page import="kickboxing.controller.NewsyManager"%>
<%

			NewsyManager man = new NewsyManager();
			List <Newsy> listaPRO =  man.wysietlWszystkieNewsy();
			
			int perPage = 4;
			int size = listaPRO.size()-1;
			int pages;
			int start=0;
			
			
			
			
		    if( request.getParameter("pages") != null && request.getParameter("pages") != "")
		    {
		    	pages = (Integer.parseInt(request.getParameter("pages")));
		    	start = (pages - 1) * perPage;
		    	
		    	if(pages < 1)  pages = 1; 
		    	
		    }
		    else
		    {
		    	pages=1;
		    }
		   
		   
		    int prev = pages - 1;
			int next = pages + 1;
			double a = (double)size / (double)perPage;
		    
			%>
		
			<%
			
			
			//max 3 strony
			if((size/perPage) < 3){
				for(int i = 1; i<=Math.ceil(a) ; i++){
					
					out.println("<a href=\"#pages\" id=\"page1h\" onClick=\"getAdv('"+i+"')\">"
							+"<img src=img/mini/pyk.jpg style=\"margin-left:10px;\"></a>");
				}
			}else{
			
				for(int i = 1; i<=3 ; i++){
				
					out.println("<a href=\"#pages\" id=\"page1h\" onClick=\"getAdv('"+i+"')\">"
					+"<img src=img/mini/pyk.jpg style=\"margin-left:10px;\"></a>");
				}
			}
			

			%>
